﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;

namespace Dashboard.Expense
{
    public partial class FormMain : Form
    {
        public FormMain()
        {
            InitializeComponent();
        }

        private void buttonExp_Click(object sender, EventArgs e)
        {
            var button = sender as Button;
            var formName = button.Text;
            var type = Type.GetType("Dashboard.Expense." + formName);
            ConstructorInfo ci = type.GetConstructor(System.Type.EmptyTypes);
            var form = ci.Invoke(null) as Form;
            form.Show();
        }
    }
}
